<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算器</title>
</head>
<body>
<form action="/calc" method="post">
    <input type="text" name="num1" value="{{ num1 }}">
    <select name="op">
        <option value="+" {% if op == '+' %}selected{% endif %}>+</option>
        <option value="-" {% if op == '-' %}selected{% endif %}>-</option>
        <option value="*" {% if op == '*' %}selected{% endif %}>*</option>
        <option value="/" {% if op == '/' %}selected{% endif %}>/</option>
    </select>
    <input type="text" name="num2" value="{{ num2 }}">
    = {{ result }}
    <br>
    <input type="submit" value="开始计算">
</form>
</body>
</html>